// 1票结，2月结
export const SettlementTypeOptions = [
  {key: 1, title: '票结'},
  {key: 2, title: '月结'}
]

// 1自营，0外派
export const SelfOperationOptions = [
  {key: 1, title: '自营'},
  {key: 0, title: '外派'}
]

// 0不开票 1增值税专用发票，2增值税普通发票
export const InvoiceOptions = [
  {key: 1, title: '增值税专用发票'},
  {key: 2, title: '增值税普通发票'}
]

// 税率
export const TaxrateOptions = [
  {key: 0, title: '0%'},
  {key: 6, title: '6%'},
  {key: 9, title: '9%'}
]

// 订单类型
export const OrderOptions = [
  {key: 'DOMESTIC_TRADE_EXPORTS', title: '内贸出口订单'},
  {key: 'DOMESTIC_TRADE_IMPORTS', title: '内贸进口订单'},
  {key: 'FOREIGN_TRADE_EXPORTS', title: '外贸出口订单'},
  {key: 'FOREIGN_TRADE_IMPORTS', title: '外贸进口订单'},
  {key: 'UNITED_TRANSPORT_EXPORTS', title: '联运出口订单'},
  {key: 'UNITED_TRANSPORT_IMPORTS', title: '联运进口订单'},
  {key: 'PURE_LAND_TRANSPORTS', title: '纯陆运订单'}
]

// 取值
export const StringifyFuc = (key, options) => {
  if (Array.isArray(options)) {
    let target = options.filter(item => item.key === key)[0]
    if (target) {
      return target.title
    }
  }
  return ''
}
